package com.weiqiao.mall.repository.impl;

import com.weiqiao.base.dao.impl.BaseMongoDaoImpl;
import com.weiqiao.mall.repository.ISupplierRepository;
import org.bson.conversions.Bson;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 供应商dao层
 *
 * @author kjy
 * @createDate 2019-10-31
 */
@Repository("SupplierRepositoryImpl")
public class SupplierRepositoryImpl extends BaseMongoDaoImpl implements ISupplierRepository {

    private final static String collectionName = "supplier_";

    @Override
    public List<String> findAllSupplier(int company_id, Bson filter, Bson sort) {
        return this.findFilterSort(collectionName + company_id, filter, sort);
    }

    @Override
    public String findSuppler(int company_id, Bson filter) {
        return super.findOne(collectionName + company_id, filter);
    }
}
